package com.young.springdemo.service.bridge;


import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

//@Component
public class TestBridge {

//    @PostConstruct
    public void testBridge() throws Exception{
        //绘制windows jpg格式
        Class<?> aClass = Class.forName("com.young.springdemo.service.bridge.WindowsImageImpl");
        ImageInterface imageInterface = (ImageInterface) aClass.newInstance();
        Class<?> aClass1 = Class.forName("com.young.springdemo.service.bridge.JPGImage");
        Image image = (Image) aClass1.newInstance();
        image.setImageInterface(imageInterface);
        image.parseFile("我是小可爱");
    }
}
